public class CommonPayMethod {

    public static boolean pay( PaymentChannel channel,PaymentMethod paymentMethod,int paymentAmount,String uid, String orderID  ){
        PayResult result = new PayResult();
        result.setPaymentAmount(paymentAmount);
        result.setPaymentChannel(channel);
        result.setPaymentMethod(paymentMethod);

        if (channel == PaymentChannel.WeChat){
            switch (paymentMethod){
                case Password :
                    webChatPassword(result);
                    break;
                case Fingerprint:
                    webChatFingerprint(result);
                    break;
                case FaceRecognition:
                    webChatFaceRecognition(result);
                    break;
                default:
                    break;
            }
        }else if(channel == PaymentChannel.AliPay){

        }


        return true;
    }

    private static boolean webChatFaceRecognition(PayResult pay) {
        System.out.println("微信人脸识别支付");
        pay.setPayedSuccess(true);
        return true;
    }

    private static boolean webChatFingerprint(PayResult pay) {
        System.out.println("微信指纹支付");
        pay.setPayedSuccess(true);
        return true;
    }

    public static boolean webChatPassword(PayResult pay){
        System.out.println("微信密码支付");
        pay.setPayedSuccess(true);
        return true;
    }

}


